 import java.util.Scanner;

public class exp1 {
    public static int gcd(int a, int b) {
        int max, min;
        max = (a > b) ? a : b;
        min = (a < b) ? a : b;
        if (max % min != 0) {
            return gcd(min,max % min);
        } else
            return min;
    }// 最大公约数（辗转相除法）
    public static int lcm(int a, int b) {
        return a * b / gcd(a, b);
    }// 最小公倍数算法（两个数之积/最大公约数）

    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int n1 = input.nextInt();
        int n2 = input.nextInt();
        System.out.println("(" + n1 + "," + n2 + ")" + "=" + gcd(n1, n2));
        System.out.println("[" + n1 + "," + n2 + "]" + "=" + lcm(n1, n2));
    }

}
